<?php

class _mysqli extends mysqli {

/*
* @return fetch_array 
*
*/
	public function query_arr($sql, $type = MYSQLI_ASSOC, $fetch_all = true) {
		$res = $this->query($sql);
		if ($res) {
			if ($fetch_all) {
				$result = array();
				while ($row = $res->fetch_array($type)) {
					$result[] = $row;
				}
			}
			else {
				$result = $res->fetch_array($type);
			}
		}
		else {
			$result = false;
		}
		return $result;
	}
	
}

?>